1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gio.FileInfo;
26 
27 private import gio.FileAttributeMatcher;
28 private import gio.IconIF;
29 private import gio.c.functions;
30 public  import gio.c.types;
31 private import glib.ConstructionException;
32 private import glib.DateTime;
33 private import glib.MemorySlice;
34 private import glib.Str;
35 private import glib.TimeVal;
36 private import glib.c.functions;
37 private import gobject.ObjectG;
38 
39 
40 /**
41  * Functionality for manipulating basic metadata for files. #GFileInfo
42  * implements methods for getting information that all files should
43  * contain, and allows for manipulation of extended attributes.
44  * 
45  * See [GFileAttribute][gio-GFileAttribute] for more information on how
46  * GIO handles file attributes.
47  * 
48  * To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
49  * async variant). To obtain a #GFileInfo for a file input or output
50  * stream, use g_file_input_stream_query_info() or
51  * g_file_output_stream_query_info() (or their async variants).
52  * 
53  * To change the actual attributes of a file, you should then set the
54  * attribute in the #GFileInfo and call g_file_set_attributes_from_info()
55  * or g_file_set_attributes_async() on a GFile.
56  * 
57  * However, not all attributes can be changed in the file. For instance,
58  * the actual size of a file cannot be changed via g_file_info_set_size().
59  * You may call g_file_query_settable_attributes() and
60  * g_file_query_writable_namespaces() to discover the settable attributes
61  * of a particular file at runtime.
62  * 
63  * The direct accessors, such as g_file_info_get_name(), are slightly more
64  * optimized than the generic attribute accessors, such as
65  * g_file_info_get_attribute_byte_string().This optimization will matter
66  * only if calling the API in a tight loop.
67  * 
68  * #GFileAttributeMatcher allows for searching through a #GFileInfo for
69  * attributes.
70  */
71 public class FileInfo : ObjectG
72 {
73 	/** the main Gtk struct */
74 	protected GFileInfo* gFileInfo;
75 
76 	/** Get the main Gtk struct */
77 	public GFileInfo* getFileInfoStruct(bool transferOwnership = false)
78 	{
79 		if (transferOwnership)
80 			ownedRef = false;
81 		return gFileInfo;
82 	}
83 
84 	/** the main Gtk struct as a void* */
85 	protected override void* getStruct()
86 	{
87 		return cast(void*)gFileInfo;
88 	}
89 
90 	/**
91 	 * Sets our main struct and passes it to the parent class.
92 	 */
93 	public this (GFileInfo* gFileInfo, bool ownedRef = false)
94 	{
95 		this.gFileInfo = gFileInfo;
96 		super(cast(GObject*)gFileInfo, ownedRef);
97 	}
98 
99 
100 	/** */
101 	public static GType getType()
102 	{
103 		return g_file_info_get_type();
104 	}
105 
106 	/**
107 	 * Creates a new file info structure.
108 	 *
109 	 * Returns: a #GFileInfo.
110 	 *
111 	 * Throws: ConstructionException GTK+ fails to create the object.
112 	 */
113 	public this()
114 	{
115 		auto __p = g_file_info_new();
116 
117 		if(__p is null)
118 		{
119 			throw new ConstructionException("null returned by new");
120 		}
121 
122 		this(cast(GFileInfo*) __p, true);
123 	}
124 
125 	/**
126 	 * Clears the status information from @info.
127 	 */
128 	public void clearStatus()
129 	{
130 		g_file_info_clear_status(gFileInfo);
131 	}
132 
133 	/**
134 	 * First clears all of the [GFileAttribute][gio-GFileAttribute] of @dest_info,
135 	 * and then copies all of the file attributes from @src_info to @dest_info.
136 	 *
137 	 * Params:
138 	 *     destInfo = destination to copy attributes to.
139 	 */
140 	public void copyInto(FileInfo destInfo)
141 	{
142 		g_file_info_copy_into(gFileInfo, (destInfo is null) ? null : destInfo.getFileInfoStruct());
143 	}
144 
145 	/**
146 	 * Duplicates a file info structure.
147 	 *
148 	 * Returns: a duplicate #GFileInfo of @other.
149 	 */
150 	public FileInfo dup()
151 	{
152 		auto __p = g_file_info_dup(gFileInfo);
153 
154 		if(__p is null)
155 		{
156 			return null;
157 		}
158 
159 		return ObjectG.getDObject!(FileInfo)(cast(GFileInfo*) __p, true);
160 	}
161 
162 	/**
163 	 * Gets the access time of the current @info and returns it as a
164 	 * #GDateTime.
165 	 *
166 	 * This requires the %G_FILE_ATTRIBUTE_TIME_ACCESS attribute. If
167 	 * %G_FILE_ATTRIBUTE_TIME_ACCESS_USEC is provided, the resulting #GDateTime
168 	 * will have microsecond precision.
169 	 *
170 	 * Returns: access time, or %NULL if unknown
171 	 *
172 	 * Since: 2.70
173 	 */
174 	public DateTime getAccessDateTime()
175 	{
176 		auto __p = g_file_info_get_access_date_time(gFileInfo);
177 
178 		if(__p is null)
179 		{
180 			return null;
181 		}
182 
183 		return new DateTime(cast(GDateTime*) __p, true);
184 	}
185 
186 	/**
187 	 * Gets the value of a attribute, formatted as a string.
188 	 * This escapes things as needed to make the string valid
189 	 * UTF-8.
190 	 *
191 	 * Params:
192 	 *     attribute = a file attribute key.
193 	 *
194 	 * Returns: a UTF-8 string associated with the given @attribute, or
195 	 *     %NULL if the attribute wasn’t set.
196 	 *     When you're done with the string it must be freed with g_free().
197 	 */
198 	public string getAttributeAsString(string attribute)
199 	{
200 		auto retStr = g_file_info_get_attribute_as_string(gFileInfo, Str.toStringz(attribute));
201 
202 		scope(exit) Str.freeString(retStr);
203 		return Str.toString(retStr);
204 	}
205 
206 	/**
207 	 * Gets the value of a boolean attribute. If the attribute does not
208 	 * contain a boolean value, %FALSE will be returned.
209 	 *
210 	 * Params:
211 	 *     attribute = a file attribute key.
212 	 *
213 	 * Returns: the boolean value contained within the attribute.
214 	 */
215 	public bool getAttributeBoolean(string attribute)
216 	{
217 		return g_file_info_get_attribute_boolean(gFileInfo, Str.toStringz(attribute)) != 0;
218 	}
219 
220 	/**
221 	 * Gets the value of a byte string attribute. If the attribute does
222 	 * not contain a byte string, %NULL will be returned.
223 	 *
224 	 * Params:
225 	 *     attribute = a file attribute key.
226 	 *
227 	 * Returns: the contents of the @attribute value as a byte string, or
228 	 *     %NULL otherwise.
229 	 */
230 	public string getAttributeByteString(string attribute)
231 	{
232 		return Str.toString(g_file_info_get_attribute_byte_string(gFileInfo, Str.toStringz(attribute)));
233 	}
234 
235 	/**
236 	 * Gets the attribute type, value and status for an attribute key.
237 	 *
238 	 * Params:
239 	 *     attribute = a file attribute key
240 	 *     type = return location for the attribute type, or %NULL
241 	 *     valuePp = return location for the
242 	 *         attribute value, or %NULL; the attribute value will not be %NULL
243 	 *     status = return location for the attribute status, or %NULL
244 	 *
245 	 * Returns: %TRUE if @info has an attribute named @attribute,
246 	 *     %FALSE otherwise.
247 	 */
248 	public bool getAttributeData(string attribute, out GFileAttributeType type, out void* valuePp, out GFileAttributeStatus status)
249 	{
250 		return g_file_info_get_attribute_data(gFileInfo, Str.toStringz(attribute), &type, &valuePp, &status) != 0;
251 	}
252 
253 	/**
254 	 * Gets a signed 32-bit integer contained within the attribute. If the
255 	 * attribute does not contain a signed 32-bit integer, or is invalid,
256 	 * 0 will be returned.
257 	 *
258 	 * Params:
259 	 *     attribute = a file attribute key.
260 	 *
261 	 * Returns: a signed 32-bit integer from the attribute.
262 	 */
263 	public int getAttributeInt32(string attribute)
264 	{
265 		return g_file_info_get_attribute_int32(gFileInfo, Str.toStringz(attribute));
266 	}
267 
268 	/**
269 	 * Gets a signed 64-bit integer contained within the attribute. If the
270 	 * attribute does not contain a signed 64-bit integer, or is invalid,
271 	 * 0 will be returned.
272 	 *
273 	 * Params:
274 	 *     attribute = a file attribute key.
275 	 *
276 	 * Returns: a signed 64-bit integer from the attribute.
277 	 */
278 	public long getAttributeInt64(string attribute)
279 	{
280 		return g_file_info_get_attribute_int64(gFileInfo, Str.toStringz(attribute));
281 	}
282 
283 	/**
284 	 * Gets the value of a #GObject attribute. If the attribute does
285 	 * not contain a #GObject, %NULL will be returned.
286 	 *
287 	 * Params:
288 	 *     attribute = a file attribute key.
289 	 *
290 	 * Returns: a #GObject associated with the given @attribute,
291 	 *     or %NULL otherwise.
292 	 */
293 	public ObjectG getAttributeObject(string attribute)
294 	{
295 		auto __p = g_file_info_get_attribute_object(gFileInfo, Str.toStringz(attribute));
296 
297 		if(__p is null)
298 		{
299 			return null;
300 		}
301 
302 		return ObjectG.getDObject!(ObjectG)(cast(GObject*) __p);
303 	}
304 
305 	/**
306 	 * Gets the attribute status for an attribute key.
307 	 *
308 	 * Params:
309 	 *     attribute = a file attribute key
310 	 *
311 	 * Returns: a #GFileAttributeStatus for the given @attribute, or
312 	 *     %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
313 	 */
314 	public GFileAttributeStatus getAttributeStatus(string attribute)
315 	{
316 		return g_file_info_get_attribute_status(gFileInfo, Str.toStringz(attribute));
317 	}
318 
319 	/**
320 	 * Gets the value of a string attribute. If the attribute does
321 	 * not contain a string, %NULL will be returned.
322 	 *
323 	 * Params:
324 	 *     attribute = a file attribute key.
325 	 *
326 	 * Returns: the contents of the @attribute value as a UTF-8 string,
327 	 *     or %NULL otherwise.
328 	 */
329 	public string getAttributeString(string attribute)
330 	{
331 		return Str.toString(g_file_info_get_attribute_string(gFileInfo, Str.toStringz(attribute)));
332 	}
333 
334 	/**
335 	 * Gets the value of a stringv attribute. If the attribute does
336 	 * not contain a stringv, %NULL will be returned.
337 	 *
338 	 * Params:
339 	 *     attribute = a file attribute key.
340 	 *
341 	 * Returns: the contents of the @attribute value as a stringv,
342 	 *     or %NULL otherwise. Do not free. These returned strings are UTF-8.
343 	 *
344 	 * Since: 2.22
345 	 */
346 	public string[] getAttributeStringv(string attribute)
347 	{
348 		return Str.toStringArray(g_file_info_get_attribute_stringv(gFileInfo, Str.toStringz(attribute)));
349 	}
350 
351 	/**
352 	 * Gets the attribute type for an attribute key.
353 	 *
354 	 * Params:
355 	 *     attribute = a file attribute key.
356 	 *
357 	 * Returns: a #GFileAttributeType for the given @attribute, or
358 	 *     %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
359 	 */
360 	public GFileAttributeType getAttributeType(string attribute)
361 	{
362 		return g_file_info_get_attribute_type(gFileInfo, Str.toStringz(attribute));
363 	}
364 
365 	/**
366 	 * Gets an unsigned 32-bit integer contained within the attribute. If the
367 	 * attribute does not contain an unsigned 32-bit integer, or is invalid,
368 	 * 0 will be returned.
369 	 *
370 	 * Params:
371 	 *     attribute = a file attribute key.
372 	 *
373 	 * Returns: an unsigned 32-bit integer from the attribute.
374 	 */
375 	public uint getAttributeUint32(string attribute)
376 	{
377 		return g_file_info_get_attribute_uint32(gFileInfo, Str.toStringz(attribute));
378 	}
379 
380 	/**
381 	 * Gets a unsigned 64-bit integer contained within the attribute. If the
382 	 * attribute does not contain an unsigned 64-bit integer, or is invalid,
383 	 * 0 will be returned.
384 	 *
385 	 * Params:
386 	 *     attribute = a file attribute key.
387 	 *
388 	 * Returns: a unsigned 64-bit integer from the attribute.
389 	 */
390 	public ulong getAttributeUint64(string attribute)
391 	{
392 		return g_file_info_get_attribute_uint64(gFileInfo, Str.toStringz(attribute));
393 	}
394 
395 	/**
396 	 * Gets the file's content type.
397 	 *
398 	 * Returns: a string containing the file's content type,
399 	 *     or %NULL if unknown.
400 	 */
401 	public string getContentType()
402 	{
403 		return Str.toString(g_file_info_get_content_type(gFileInfo));
404 	}
405 
406 	/**
407 	 * Gets the creation time of the current @info and returns it as a
408 	 * #GDateTime.
409 	 *
410 	 * This requires the %G_FILE_ATTRIBUTE_TIME_CREATED attribute. If
411 	 * %G_FILE_ATTRIBUTE_TIME_CREATED_USEC is provided, the resulting #GDateTime
412 	 * will have microsecond precision.
413 	 *
414 	 * Returns: creation time, or %NULL if unknown
415 	 *
416 	 * Since: 2.70
417 	 */
418 	public DateTime getCreationDateTime()
419 	{
420 		auto __p = g_file_info_get_creation_date_time(gFileInfo);
421 
422 		if(__p is null)
423 		{
424 			return null;
425 		}
426 
427 		return new DateTime(cast(GDateTime*) __p, true);
428 	}
429 
430 	/**
431 	 * Returns the #GDateTime representing the deletion date of the file, as
432 	 * available in G_FILE_ATTRIBUTE_TRASH_DELETION_DATE. If the
433 	 * G_FILE_ATTRIBUTE_TRASH_DELETION_DATE attribute is unset, %NULL is returned.
434 	 *
435 	 * Returns: a #GDateTime, or %NULL.
436 	 *
437 	 * Since: 2.36
438 	 */
439 	public DateTime getDeletionDate()
440 	{
441 		auto __p = g_file_info_get_deletion_date(gFileInfo);
442 
443 		if(__p is null)
444 		{
445 			return null;
446 		}
447 
448 		return new DateTime(cast(GDateTime*) __p, true);
449 	}
450 
451 	/**
452 	 * Gets a display name for a file. This is guaranteed to always be set.
453 	 *
454 	 * Returns: a string containing the display name.
455 	 */
456 	public string getDisplayName()
457 	{
458 		return Str.toString(g_file_info_get_display_name(gFileInfo));
459 	}
460 
461 	/**
462 	 * Gets the edit name for a file.
463 	 *
464 	 * Returns: a string containing the edit name.
465 	 */
466 	public string getEditName()
467 	{
468 		return Str.toString(g_file_info_get_edit_name(gFileInfo));
469 	}
470 
471 	/**
472 	 * Gets the [entity tag][gfile-etag] for a given
473 	 * #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
474 	 *
475 	 * Returns: a string containing the value of the "etag:value" attribute.
476 	 */
477 	public string getEtag()
478 	{
479 		return Str.toString(g_file_info_get_etag(gFileInfo));
480 	}
481 
482 	/**
483 	 * Gets a file's type (whether it is a regular file, symlink, etc).
484 	 * This is different from the file's content type, see g_file_info_get_content_type().
485 	 *
486 	 * Returns: a #GFileType for the given file.
487 	 */
488 	public GFileType getFileType()
489 	{
490 		return g_file_info_get_file_type(gFileInfo);
491 	}
492 
493 	/**
494 	 * Gets the icon for a file.
495 	 *
496 	 * Returns: #GIcon for the given @info.
497 	 */
498 	public IconIF getIcon()
499 	{
500 		auto __p = g_file_info_get_icon(gFileInfo);
501 
502 		if(__p is null)
503 		{
504 			return null;
505 		}
506 
507 		return ObjectG.getDObject!(IconIF)(cast(GIcon*) __p);
508 	}
509 
510 	/**
511 	 * Checks if a file is a backup file.
512 	 *
513 	 * Returns: %TRUE if file is a backup file, %FALSE otherwise.
514 	 */
515 	public bool getIsBackup()
516 	{
517 		return g_file_info_get_is_backup(gFileInfo) != 0;
518 	}
519 
520 	/**
521 	 * Checks if a file is hidden.
522 	 *
523 	 * Returns: %TRUE if the file is a hidden file, %FALSE otherwise.
524 	 */
525 	public bool getIsHidden()
526 	{
527 		return g_file_info_get_is_hidden(gFileInfo) != 0;
528 	}
529 
530 	/**
531 	 * Checks if a file is a symlink.
532 	 *
533 	 * Returns: %TRUE if the given @info is a symlink.
534 	 */
535 	public bool getIsSymlink()
536 	{
537 		return g_file_info_get_is_symlink(gFileInfo) != 0;
538 	}
539 
540 	/**
541 	 * Gets the modification time of the current @info and returns it as a
542 	 * #GDateTime.
543 	 *
544 	 * This requires the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute. If
545 	 * %G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC is provided, the resulting #GDateTime
546 	 * will have microsecond precision.
547 	 *
548 	 * Returns: modification time, or %NULL if unknown
549 	 *
550 	 * Since: 2.62
551 	 */
552 	public DateTime getModificationDateTime()
553 	{
554 		auto __p = g_file_info_get_modification_date_time(gFileInfo);
555 
556 		if(__p is null)
557 		{
558 			return null;
559 		}
560 
561 		return new DateTime(cast(GDateTime*) __p, true);
562 	}
563 
564 	/**
565 	 * Gets the modification time of the current @info and sets it
566 	 * in @result.
567 	 *
568 	 * Deprecated: Use g_file_info_get_modification_date_time() instead, as
569 	 * #GTimeVal is deprecated due to the year 2038 problem.
570 	 *
571 	 * Params:
572 	 *     result = a #GTimeVal.
573 	 */
574 	public void getModificationTime(out TimeVal result)
575 	{
576 		GTimeVal* outresult = sliceNew!GTimeVal();
577 
578 		g_file_info_get_modification_time(gFileInfo, outresult);
579 
580 		result = new TimeVal(outresult, true);
581 	}
582 
583 	/**
584 	 * Gets the name for a file. This is guaranteed to always be set.
585 	 *
586 	 * Returns: a string containing the file name.
587 	 */
588 	public string getName()
589 	{
590 		return Str.toString(g_file_info_get_name(gFileInfo));
591 	}
592 
593 	/**
594 	 * Gets the file's size (in bytes). The size is retrieved through the value of
595 	 * the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute and is converted
596 	 * from #guint64 to #goffset before returning the result.
597 	 *
598 	 * Returns: a #goffset containing the file's size (in bytes).
599 	 */
600 	public long getSize()
601 	{
602 		return g_file_info_get_size(gFileInfo);
603 	}
604 
605 	/**
606 	 * Gets the value of the sort_order attribute from the #GFileInfo.
607 	 * See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
608 	 *
609 	 * Returns: a #gint32 containing the value of the "standard::sort_order" attribute.
610 	 */
611 	public int getSortOrder()
612 	{
613 		return g_file_info_get_sort_order(gFileInfo);
614 	}
615 
616 	/**
617 	 * Gets the symbolic icon for a file.
618 	 *
619 	 * Returns: #GIcon for the given @info.
620 	 *
621 	 * Since: 2.34
622 	 */
623 	public IconIF getSymbolicIcon()
624 	{
625 		auto __p = g_file_info_get_symbolic_icon(gFileInfo);
626 
627 		if(__p is null)
628 		{
629 			return null;
630 		}
631 
632 		return ObjectG.getDObject!(IconIF)(cast(GIcon*) __p);
633 	}
634 
635 	/**
636 	 * Gets the symlink target for a given #GFileInfo.
637 	 *
638 	 * Returns: a string containing the symlink target.
639 	 */
640 	public string getSymlinkTarget()
641 	{
642 		return Str.toString(g_file_info_get_symlink_target(gFileInfo));
643 	}
644 
645 	/**
646 	 * Checks if a file info structure has an attribute named @attribute.
647 	 *
648 	 * Params:
649 	 *     attribute = a file attribute key.
650 	 *
651 	 * Returns: %TRUE if @info has an attribute named @attribute,
652 	 *     %FALSE otherwise.
653 	 */
654 	public bool hasAttribute(string attribute)
655 	{
656 		return g_file_info_has_attribute(gFileInfo, Str.toStringz(attribute)) != 0;
657 	}
658 
659 	/**
660 	 * Checks if a file info structure has an attribute in the
661 	 * specified @name_space.
662 	 *
663 	 * Params:
664 	 *     nameSpace = a file attribute namespace.
665 	 *
666 	 * Returns: %TRUE if @info has an attribute in @name_space,
667 	 *     %FALSE otherwise.
668 	 *
669 	 * Since: 2.22
670 	 */
671 	public bool hasNamespace(string nameSpace)
672 	{
673 		return g_file_info_has_namespace(gFileInfo, Str.toStringz(nameSpace)) != 0;
674 	}
675 
676 	/**
677 	 * Lists the file info structure's attributes.
678 	 *
679 	 * Params:
680 	 *     nameSpace = a file attribute key's namespace, or %NULL to list
681 	 *         all attributes.
682 	 *
683 	 * Returns: a
684 	 *     null-terminated array of strings of all of the possible attribute
685 	 *     types for the given @name_space, or %NULL on error.
686 	 */
687 	public string[] listAttributes(string nameSpace)
688 	{
689 		auto retStr = g_file_info_list_attributes(gFileInfo, Str.toStringz(nameSpace));
690 
691 		scope(exit) Str.freeStringArray(retStr);
692 		return Str.toStringArray(retStr);
693 	}
694 
695 	/**
696 	 * Removes all cases of @attribute from @info if it exists.
697 	 *
698 	 * Params:
699 	 *     attribute = a file attribute key.
700 	 */
701 	public void removeAttribute(string attribute)
702 	{
703 		g_file_info_remove_attribute(gFileInfo, Str.toStringz(attribute));
704 	}
705 
706 	/**
707 	 * Sets the %G_FILE_ATTRIBUTE_TIME_ACCESS and
708 	 * %G_FILE_ATTRIBUTE_TIME_ACCESS_USEC attributes in the file info to the
709 	 * given date/time value.
710 	 *
711 	 * Params:
712 	 *     atime = a #GDateTime.
713 	 *
714 	 * Since: 2.70
715 	 */
716 	public void setAccessDateTime(DateTime atime)
717 	{
718 		g_file_info_set_access_date_time(gFileInfo, (atime is null) ? null : atime.getDateTimeStruct());
719 	}
720 
721 	/**
722 	 * Sets the @attribute to contain the given value, if possible. To unset the
723 	 * attribute, use %G_FILE_ATTRIBUTE_TYPE_INVALID for @type.
724 	 *
725 	 * Params:
726 	 *     attribute = a file attribute key.
727 	 *     type = a #GFileAttributeType
728 	 *     valueP = pointer to the value
729 	 */
730 	public void setAttribute(string attribute, GFileAttributeType type, void* valueP)
731 	{
732 		g_file_info_set_attribute(gFileInfo, Str.toStringz(attribute), type, valueP);
733 	}
734 
735 	/**
736 	 * Sets the @attribute to contain the given @attr_value,
737 	 * if possible.
738 	 *
739 	 * Params:
740 	 *     attribute = a file attribute key.
741 	 *     attrValue = a boolean value.
742 	 */
743 	public void setAttributeBoolean(string attribute, bool attrValue)
744 	{
745 		g_file_info_set_attribute_boolean(gFileInfo, Str.toStringz(attribute), attrValue);
746 	}
747 
748 	/**
749 	 * Sets the @attribute to contain the given @attr_value,
750 	 * if possible.
751 	 *
752 	 * Params:
753 	 *     attribute = a file attribute key.
754 	 *     attrValue = a byte string.
755 	 */
756 	public void setAttributeByteString(string attribute, string attrValue)
757 	{
758 		g_file_info_set_attribute_byte_string(gFileInfo, Str.toStringz(attribute), Str.toStringz(attrValue));
759 	}
760 
761 	/**
762 	 * Sets the @attribute to contain the given @attr_value,
763 	 * if possible.
764 	 *
765 	 * Params:
766 	 *     attribute = a file attribute key.
767 	 *     attrValue = a signed 32-bit integer
768 	 */
769 	public void setAttributeInt32(string attribute, int attrValue)
770 	{
771 		g_file_info_set_attribute_int32(gFileInfo, Str.toStringz(attribute), attrValue);
772 	}
773 
774 	/**
775 	 * Sets the @attribute to contain the given @attr_value,
776 	 * if possible.
777 	 *
778 	 * Params:
779 	 *     attribute = attribute name to set.
780 	 *     attrValue = int64 value to set attribute to.
781 	 */
782 	public void setAttributeInt64(string attribute, long attrValue)
783 	{
784 		g_file_info_set_attribute_int64(gFileInfo, Str.toStringz(attribute), attrValue);
785 	}
786 
787 	/**
788 	 * Sets @mask on @info to match specific attribute types.
789 	 *
790 	 * Params:
791 	 *     mask = a #GFileAttributeMatcher.
792 	 */
793 	public void setAttributeMask(FileAttributeMatcher mask)
794 	{
795 		g_file_info_set_attribute_mask(gFileInfo, (mask is null) ? null : mask.getFileAttributeMatcherStruct());
796 	}
797 
798 	/**
799 	 * Sets the @attribute to contain the given @attr_value,
800 	 * if possible.
801 	 *
802 	 * Params:
803 	 *     attribute = a file attribute key.
804 	 *     attrValue = a #GObject.
805 	 */
806 	public void setAttributeObject(string attribute, ObjectG attrValue)
807 	{
808 		g_file_info_set_attribute_object(gFileInfo, Str.toStringz(attribute), (attrValue is null) ? null : attrValue.getObjectGStruct());
809 	}
810 
811 	/**
812 	 * Sets the attribute status for an attribute key. This is only
813 	 * needed by external code that implement g_file_set_attributes_from_info()
814 	 * or similar functions.
815 	 *
816 	 * The attribute must exist in @info for this to work. Otherwise %FALSE
817 	 * is returned and @info is unchanged.
818 	 *
819 	 * Params:
820 	 *     attribute = a file attribute key
821 	 *     status = a #GFileAttributeStatus
822 	 *
823 	 * Returns: %TRUE if the status was changed, %FALSE if the key was not set.
824 	 *
825 	 * Since: 2.22
826 	 */
827 	public bool setAttributeStatus(string attribute, GFileAttributeStatus status)
828 	{
829 		return g_file_info_set_attribute_status(gFileInfo, Str.toStringz(attribute), status) != 0;
830 	}
831 
832 	/**
833 	 * Sets the @attribute to contain the given @attr_value,
834 	 * if possible.
835 	 *
836 	 * Params:
837 	 *     attribute = a file attribute key.
838 	 *     attrValue = a UTF-8 string.
839 	 */
840 	public void setAttributeString(string attribute, string attrValue)
841 	{
842 		g_file_info_set_attribute_string(gFileInfo, Str.toStringz(attribute), Str.toStringz(attrValue));
843 	}
844 
845 	/**
846 	 * Sets the @attribute to contain the given @attr_value,
847 	 * if possible.
848 	 *
849 	 * Sinze: 2.22
850 	 *
851 	 * Params:
852 	 *     attribute = a file attribute key
853 	 *     attrValue = a %NULL
854 	 *         terminated array of UTF-8 strings.
855 	 */
856 	public void setAttributeStringv(string attribute, string[] attrValue)
857 	{
858 		g_file_info_set_attribute_stringv(gFileInfo, Str.toStringz(attribute), Str.toStringzArray(attrValue));
859 	}
860 
861 	/**
862 	 * Sets the @attribute to contain the given @attr_value,
863 	 * if possible.
864 	 *
865 	 * Params:
866 	 *     attribute = a file attribute key.
867 	 *     attrValue = an unsigned 32-bit integer.
868 	 */
869 	public void setAttributeUint32(string attribute, uint attrValue)
870 	{
871 		g_file_info_set_attribute_uint32(gFileInfo, Str.toStringz(attribute), attrValue);
872 	}
873 
874 	/**
875 	 * Sets the @attribute to contain the given @attr_value,
876 	 * if possible.
877 	 *
878 	 * Params:
879 	 *     attribute = a file attribute key.
880 	 *     attrValue = an unsigned 64-bit integer.
881 	 */
882 	public void setAttributeUint64(string attribute, ulong attrValue)
883 	{
884 		g_file_info_set_attribute_uint64(gFileInfo, Str.toStringz(attribute), attrValue);
885 	}
886 
887 	/**
888 	 * Sets the content type attribute for a given #GFileInfo.
889 	 * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
890 	 *
891 	 * Params:
892 	 *     contentType = a content type. See [GContentType][gio-GContentType]
893 	 */
894 	public void setContentType(string contentType)
895 	{
896 		g_file_info_set_content_type(gFileInfo, Str.toStringz(contentType));
897 	}
898 
899 	/**
900 	 * Sets the %G_FILE_ATTRIBUTE_TIME_CREATED and
901 	 * %G_FILE_ATTRIBUTE_TIME_CREATED_USEC attributes in the file info to the
902 	 * given date/time value.
903 	 *
904 	 * Params:
905 	 *     creationTime = a #GDateTime.
906 	 *
907 	 * Since: 2.70
908 	 */
909 	public void setCreationDateTime(DateTime creationTime)
910 	{
911 		g_file_info_set_creation_date_time(gFileInfo, (creationTime is null) ? null : creationTime.getDateTimeStruct());
912 	}
913 
914 	/**
915 	 * Sets the display name for the current #GFileInfo.
916 	 * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
917 	 *
918 	 * Params:
919 	 *     displayName = a string containing a display name.
920 	 */
921 	public void setDisplayName(string displayName)
922 	{
923 		g_file_info_set_display_name(gFileInfo, Str.toStringz(displayName));
924 	}
925 
926 	/**
927 	 * Sets the edit name for the current file.
928 	 * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
929 	 *
930 	 * Params:
931 	 *     editName = a string containing an edit name.
932 	 */
933 	public void setEditName(string editName)
934 	{
935 		g_file_info_set_edit_name(gFileInfo, Str.toStringz(editName));
936 	}
937 
938 	/**
939 	 * Sets the file type in a #GFileInfo to @type.
940 	 * See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
941 	 *
942 	 * Params:
943 	 *     type = a #GFileType.
944 	 */
945 	public void setFileType(GFileType type)
946 	{
947 		g_file_info_set_file_type(gFileInfo, type);
948 	}
949 
950 	/**
951 	 * Sets the icon for a given #GFileInfo.
952 	 * See %G_FILE_ATTRIBUTE_STANDARD_ICON.
953 	 *
954 	 * Params:
955 	 *     icon = a #GIcon.
956 	 */
957 	public void setIcon(IconIF icon)
958 	{
959 		g_file_info_set_icon(gFileInfo, (icon is null) ? null : icon.getIconStruct());
960 	}
961 
962 	/**
963 	 * Sets the "is_hidden" attribute in a #GFileInfo according to @is_hidden.
964 	 * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
965 	 *
966 	 * Params:
967 	 *     isHidden = a #gboolean.
968 	 */
969 	public void setIsHidden(bool isHidden)
970 	{
971 		g_file_info_set_is_hidden(gFileInfo, isHidden);
972 	}
973 
974 	/**
975 	 * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
976 	 * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
977 	 *
978 	 * Params:
979 	 *     isSymlink = a #gboolean.
980 	 */
981 	public void setIsSymlink(bool isSymlink)
982 	{
983 		g_file_info_set_is_symlink(gFileInfo, isSymlink);
984 	}
985 
986 	/**
987 	 * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED and
988 	 * %G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC attributes in the file info to the
989 	 * given date/time value.
990 	 *
991 	 * Params:
992 	 *     mtime = a #GDateTime.
993 	 *
994 	 * Since: 2.62
995 	 */
996 	public void setModificationDateTime(DateTime mtime)
997 	{
998 		g_file_info_set_modification_date_time(gFileInfo, (mtime is null) ? null : mtime.getDateTimeStruct());
999 	}
1000 
1001 	/**
1002 	 * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED and
1003 	 * %G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC attributes in the file info to the
1004 	 * given time value.
1005 	 *
1006 	 * Deprecated: Use g_file_info_set_modification_date_time() instead, as
1007 	 * #GTimeVal is deprecated due to the year 2038 problem.
1008 	 *
1009 	 * Params:
1010 	 *     mtime = a #GTimeVal.
1011 	 */
1012 	public void setModificationTime(TimeVal mtime)
1013 	{
1014 		g_file_info_set_modification_time(gFileInfo, (mtime is null) ? null : mtime.getTimeValStruct());
1015 	}
1016 
1017 	/**
1018 	 * Sets the name attribute for the current #GFileInfo.
1019 	 * See %G_FILE_ATTRIBUTE_STANDARD_NAME.
1020 	 *
1021 	 * Params:
1022 	 *     name = a string containing a name.
1023 	 */
1024 	public void setName(string name)
1025 	{
1026 		g_file_info_set_name(gFileInfo, Str.toStringz(name));
1027 	}
1028 
1029 	/**
1030 	 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
1031 	 * to the given size.
1032 	 *
1033 	 * Params:
1034 	 *     size = a #goffset containing the file's size.
1035 	 */
1036 	public void setSize(long size)
1037 	{
1038 		g_file_info_set_size(gFileInfo, size);
1039 	}
1040 
1041 	/**
1042 	 * Sets the sort order attribute in the file info structure. See
1043 	 * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
1044 	 *
1045 	 * Params:
1046 	 *     sortOrder = a sort order integer.
1047 	 */
1048 	public void setSortOrder(int sortOrder)
1049 	{
1050 		g_file_info_set_sort_order(gFileInfo, sortOrder);
1051 	}
1052 
1053 	/**
1054 	 * Sets the symbolic icon for a given #GFileInfo.
1055 	 * See %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.
1056 	 *
1057 	 * Params:
1058 	 *     icon = a #GIcon.
1059 	 *
1060 	 * Since: 2.34
1061 	 */
1062 	public void setSymbolicIcon(IconIF icon)
1063 	{
1064 		g_file_info_set_symbolic_icon(gFileInfo, (icon is null) ? null : icon.getIconStruct());
1065 	}
1066 
1067 	/**
1068 	 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
1069 	 * to the given symlink target.
1070 	 *
1071 	 * Params:
1072 	 *     symlinkTarget = a static string containing a path to a symlink target.
1073 	 */
1074 	public void setSymlinkTarget(string symlinkTarget)
1075 	{
1076 		g_file_info_set_symlink_target(gFileInfo, Str.toStringz(symlinkTarget));
1077 	}
1078 
1079 	/**
1080 	 * Unsets a mask set by g_file_info_set_attribute_mask(), if one
1081 	 * is set.
1082 	 */
1083 	public void unsetAttributeMask()
1084 	{
1085 		g_file_info_unset_attribute_mask(gFileInfo);
1086 	}
1087 }